CREATE TABLE [dbo].[TDUSUA_CLAV]
(
[CO_USUA] [dbo].[TD_VC_008] NOT NULL,
[NU_SECU] [dbo].[TD_IN_001] NOT NULL CONSTRAINT [DF__TDUSUA_CL__NU_SE__4222D4EF] DEFAULT ((0)),
[NO_CLAV] [dbo].[TD_VC_020] NOT NULL,
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NULL CONSTRAINT [DF__TDUSUA_CL__CO_US__4316F928] DEFAULT (substring(suser_sname(),(1),(8))),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NULL CONSTRAINT [DF__TDUSUA_CL__FE_US__440B1D61] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NULL CONSTRAINT [DF__TDUSUA_CL__CO_US__44FF419A] DEFAULT (substring(suser_sname(),(1),(8))),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NULL CONSTRAINT [DF__TDUSUA_CL__FE_US__45F365D3] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TDUSUA_CLAV] ADD CONSTRAINT [PK__TDUSUA_C__1A699AF36F1576F7] PRIMARY KEY CLUSTERED  ([CO_USUA], [NU_SECU]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TDUSUA_CLAV] ADD CONSTRAINT [FK__TDUSUA_CL__CO_US__290D0E62] FOREIGN KEY ([CO_USUA]) REFERENCES [dbo].[TMUSUA] ([CO_USUA])
GO
GRANT SELECT ON  [dbo].[TDUSUA_CLAV] TO [public]
GRANT INSERT ON  [dbo].[TDUSUA_CLAV] TO [public]
GRANT DELETE ON  [dbo].[TDUSUA_CLAV] TO [public]
GRANT UPDATE ON  [dbo].[TDUSUA_CLAV] TO [public]
GO
